package com.koron.tool.frame;

import java.awt.event.ActionEvent;
import java.beans.PropertyVetoException;
import java.util.ResourceBundle;

import javax.swing.AbstractAction;

import com.koron.tool.MainFrame;

/**
 * 支持小键盘制表的编辑器EditorAction
 * 
 * @author swan
 *
 */
public class EditorAction extends AbstractAction {
	private MainFrame frame;
	private ResourceBundle resourceBuddle = null;

	public EditorAction(MainFrame frame) {
		this.frame = frame;
		resourceBuddle = ResourceBundle.getBundle(MainFrame.RESOURCEBUDDLE, frame.getLocale());
		putValue(NAME, "编辑器");
	}

	@Override
	public void actionPerformed(ActionEvent e) {
		EditorFrame inf = new EditorFrame(frame);
		frame.getDesktop().add(inf);
		try {
			inf.setVisible(true);
			inf.setSelected(true);
		} catch (PropertyVetoException e1) {
			e1.printStackTrace();
		}
	}
}
